/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Visao.Funcionario.Pedido;

import Controle.Controlador;
import Visao.TelaPrincipal;
import java.util.ArrayList;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Andre Luiz
 */
public class AcompanharPedido extends javax.swing.JFrame {
    TelaPrincipal tela;
    DefaultTableModel modelo2;
    DefaultTableModel modelo3;
    /**
     * Creates new form AcompanharPedido
     */
    public AcompanharPedido(TelaPrincipal tela, int codigoPedido, int codigoCliente, float txEntrega, float desc, float total) {
        initComponents();
        this.tela = tela;
        modelo2 = (DefaultTableModel) jtTabelaPizzas.getModel();
        modelo3 = (DefaultTableModel) jtTabelaAcomp.getModel();
        Integer codEnderecoEntrega = Controlador.get_CodigoEnderecoEntregaPedido(codigoPedido);
        setDadosVisao(Controlador.convertModeloClienteToDadosVisao(codigoCliente));
        if(codEnderecoEntrega!=null){
            setDadosVisaoEndEntrega(Controlador.convertModeloEnderecoEntregaToDadosVisao(codEnderecoEntrega));
        }
        ArrayList<ArrayList<String>> pizzas = Controlador.carregarDadosBD_ItemPizzaPedido(codigoPedido);
        ArrayList<ArrayList<String>> acomp = Controlador.carregarDadosBD_ItemAcompanhentoPedido(codigoPedido);
        removeLinhasTabelaPizzas();
        removeLinhasTabelaAcomp();

        if(pizzas != null){
            imprimeDadosTabelaPizzas(pizzas);
        }
        if(acomp!= null){
            imprimeDadosTabelaAcomp(acomp);
        }
        jtTotal.setText(setFormatoMoeda(""+total));
        jtTxEntrega.setText(""+txEntrega);
        jtDesconto.setText(setFormatoMoeda(""+desc));
    }
    
    private void setDadosVisao(ArrayList<String> param) {
        try {
            
            jtfNome.setText(param.get(1));
            jftfRg.setText(param.get(2));
            
            if(param.get(3)!= null && !"".equals(param.get(3))){
                jtfDataNasc.setText(param.get(3));
            }
            if(param.get(5)!= null && !"".equals(param.get(5))){
                jtftel_1.setText(param.get(5));
            }
            if(param.get(6)!= null && !"".equals(param.get(6))){
                jtftel_2.setText(param.get(6));
            }
            
        } catch (Exception ex) {
            JOptionPane.showMessageDialog(rootPane, "Erro ao Setar dados do Cliente na tela\n"+ex.getMessage(), "Erro!", 0);
        }
    }

    private void setDadosVisaoEndEntrega(ArrayList<String> param) {
        try {
            jcbBairro.setSelectedItem(param.get(1));
            jftRua.setText(param.get(2));
            jtfNum.setText(param.get(3).replace(" ", ""));
            jtfComp.setText(param.get(4));
        } catch (Exception e) {
            JOptionPane.showMessageDialog(rootPane, "Erro ao Setar dados do Endereço de Entrega do Pedido na tela\n"+e.getMessage(), "Erro!", 0);
        }
        
    }
    
    private void imprimeDadosTabelaPizzas(ArrayList<ArrayList<String>> pizzas) {
        int linhaTabela = 0;
        try {
            for (int i = 0; i < pizzas.size(); i++) {            
                System.out.println("pizza: "+pizzas.get(i).get(0));
                System.out.println("pizza: "+pizzas.get(i).get(1));
                System.out.println("pizza: "+pizzas.get(i).get(2));
                modelo2.addRow(new String[]{"", ""});
                
                jtTabelaPizzas.setValueAt(pizzas.get(i).get(0), linhaTabela, 0);
                jtTabelaPizzas.setValueAt(pizzas.get(i).get(1), linhaTabela, 1);
                jtTabelaPizzas.setValueAt(pizzas.get(i).get(2), linhaTabela, 2);

                linhaTabela++;
            }
        } catch (Exception e) {
            System.out.println("Erro ao Imprimir dados na tabela Pizzas!\n"+ e.getMessage());
        }
    }
    
    private void removeLinhasTabelaPizzas(){
        for (int i = 0; i < jtTabelaPizzas.getRowCount(); i++) {
            modelo2.removeRow(i);
        }
    }
    
    private void imprimeDadosTabelaAcomp(ArrayList<ArrayList<String>> acomp) {
        int linhaTabela = 0;
        try {
            for (int i = 0; i < acomp.size(); i++) {            

                modelo3.addRow(new String[]{"", ""});
                
                jtTabelaAcomp.setValueAt(acomp.get(i).get(1), linhaTabela, 0);
                jtTabelaAcomp.setValueAt(acomp.get(i).get(2), linhaTabela, 1);

                linhaTabela++;
            }
        } catch (Exception e) {
            System.out.println("Erro ao Imprimir dados na tabela de Acompanhamestos do Pedido!\n"+ e.getMessage());
        }
    }
    
    private void removeLinhasTabelaAcomp(){
        for (int i = 0; i < jtTabelaAcomp.getRowCount(); i++) {
            modelo3.removeRow(i);
        }
    }
    
    private String setFormatoMoeda(String str){
        str=str.replace("R$ ", "");
        str=str.replace(" ", "");
        
        if(str.contains(".")){
            int index = str.indexOf(".");
            String parteInteira = str.substring(0, index);
            String parteFracionaria = str.substring(index+1);
            if(parteFracionaria.length()<2)
                parteFracionaria+="0";
            if(parteFracionaria.length()>2)
                parteFracionaria = parteFracionaria.substring(0, 1);
            //jtaxaEntregaTF.setText("R$ "+parteInteira+","+parteFracionaria);
            return "R$ "+parteInteira+"."+parteFracionaria;
        }
        else{
            System.out.println("chego");
            return "R$ "+str+".00";
        }
        
    }
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jtfNome = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jtfDataNasc = new javax.swing.JFormattedTextField();
        jftfRg = new javax.swing.JFormattedTextField();
        jLabel7 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jtftel_1 = new javax.swing.JFormattedTextField();
        jLabel10 = new javax.swing.JLabel();
        jtftel_2 = new javax.swing.JFormattedTextField();
        jPanel2 = new javax.swing.JPanel();
        jLabel9 = new javax.swing.JLabel();
        jcbBairro = new javax.swing.JComboBox();
        jLabel3 = new javax.swing.JLabel();
        jftRua = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jtfNum = new javax.swing.JFormattedTextField();
        jLabel5 = new javax.swing.JLabel();
        jtfComp = new javax.swing.JTextField();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        jtTabelaPizzas = new javax.swing.JTable();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jtTabelaAcomp = new javax.swing.JTable();
        jLabel8 = new javax.swing.JLabel();
        jtTotal = new javax.swing.JTextField();
        jtTxEntrega = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jtDesconto = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Acompanhar Pedido");

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Cliente", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12), new java.awt.Color(0, 0, 0))); // NOI18N
        jPanel1.setPreferredSize(new java.awt.Dimension(365, 120));

        jLabel1.setText(" Nome:");

        jtfNome.setBackground(new java.awt.Color(255, 255, 255));
        jtfNome.setEditable(false);
        jtfNome.setPreferredSize(new java.awt.Dimension(290, 20));
        jtfNome.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtfNomeActionPerformed(evt);
            }
        });

        jLabel6.setText("Data Nasc:");

        jtfDataNasc.setBackground(new java.awt.Color(255, 255, 255));
        jtfDataNasc.setEditable(false);
        try {
            jtfDataNasc.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jtfDataNasc.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jtfDataNasc.setFocusLostBehavior(javax.swing.JFormattedTextField.COMMIT);
        jtfDataNasc.setPreferredSize(new java.awt.Dimension(110, 20));

        jftfRg.setBackground(new java.awt.Color(255, 255, 255));
        jftfRg.setEditable(false);
        try {
            jftfRg.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("########")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jftfRg.setFocusLostBehavior(javax.swing.JFormattedTextField.COMMIT);
        jftfRg.setPreferredSize(new java.awt.Dimension(110, 20));

        jLabel7.setText("RG:");

        jLabel2.setText("Tel_1:");

        jtftel_1.setBackground(new java.awt.Color(255, 255, 255));
        jtftel_1.setEditable(false);
        try {
            jtftel_1.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("## ####-####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jtftel_1.setFocusLostBehavior(javax.swing.JFormattedTextField.COMMIT);
        jtftel_1.setPreferredSize(new java.awt.Dimension(110, 20));

        jLabel10.setText("Tel_2:");

        jtftel_2.setBackground(new java.awt.Color(255, 255, 255));
        jtftel_2.setEditable(false);
        try {
            jtftel_2.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("## ####-####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jtftel_2.setFocusLostBehavior(javax.swing.JFormattedTextField.COMMIT);
        jtftel_2.setPreferredSize(new java.awt.Dimension(110, 20));

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.TRAILING))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jftfRg, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel6)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfDataNasc, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jtftel_1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(33, 33, 33)
                        .addComponent(jLabel10)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtftel_2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jtfNome, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(28, 28, 28))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jtfNome, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jftfRg, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel7)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jtfDataNasc, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel6)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtftel_1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel2)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jtftel_2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel10))
                        .addGap(24, 24, 24))))
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Endereço de Entrega", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12), new java.awt.Color(0, 0, 0))); // NOI18N
        jPanel2.setPreferredSize(new java.awt.Dimension(365, 120));

        jLabel9.setText("Bairro:");

        jcbBairro.setModel(new javax.swing.DefaultComboBoxModel(new String[] { " ", "Alto Alegre", "Brasília", "Brazmadeira", "Canadá", "Cancelli", "Cascavel Velho", "Cataratas", "Centro", "Coqueiral", "Country", "Esmeralda", "Floresta", "Guarujá", "Interlagos", "Maria Luiza", "Morumbi", "Neva", "Pacaembu", "Parque São Paulo", "Parque Verde", "Periolo", "Pioneiros Catarinenses", "Recanto Tropical", "Região do Lago", "Santa Cruz", "Santa Felicidade", "Santo Onofre", "Santos Dumont", "São Cristóvão", "Universitário", "XIV De Novembro" }));
        jcbBairro.setPreferredSize(new java.awt.Dimension(196, 20));
        jcbBairro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcbBairroActionPerformed(evt);
            }
        });

        jLabel3.setText("Rua:");

        jftRua.setBackground(new java.awt.Color(255, 255, 255));
        jftRua.setEditable(false);

        jLabel4.setText("Nº:");

        jtfNum.setBackground(new java.awt.Color(255, 255, 255));
        jtfNum.setEditable(false);
        try {
            jtfNum.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("#####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jtfNum.setPreferredSize(new java.awt.Dimension(75, 20));

        jLabel5.setText("Comp:");

        jtfComp.setBackground(new java.awt.Color(255, 255, 255));
        jtfComp.setEditable(false);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel2Layout.createSequentialGroup()
                            .addComponent(jLabel9)
                            .addGap(2, 2, 2)
                            .addComponent(jcbBairro, 0, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jPanel2Layout.createSequentialGroup()
                            .addGap(6, 6, 6)
                            .addComponent(jLabel3)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jftRua, javax.swing.GroupLayout.PREFERRED_SIZE, 196, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jLabel4)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jtfNum, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfComp, javax.swing.GroupLayout.PREFERRED_SIZE, 264, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(jcbBairro, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(3, 3, 3)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jftRua)
                    .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jtfNum, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtfComp)
                    .addComponent(jLabel5))
                .addGap(31, 31, 31))
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "PIzzas Pedido", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12), new java.awt.Color(0, 0, 0))); // NOI18N

        jtTabelaPizzas.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Sabores", "Tamanho", "Valor"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jtTabelaPizzas.setPreferredSize(new java.awt.Dimension(255, 100));
        jScrollPane4.setViewportView(jtTabelaPizzas);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 346, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Acompanhamentos Pedido", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12), new java.awt.Color(0, 0, 0))); // NOI18N

        jtTabelaAcomp.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Produto", "Valor"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jtTabelaAcomp.setPreferredSize(new java.awt.Dimension(255, 100));
        jScrollPane2.setViewportView(jtTabelaAcomp);

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel4Layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addContainerGap()))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 104, Short.MAX_VALUE)
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel4Layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addContainerGap()))
        );

        jLabel8.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel8.setText("TOTAL:");

        jtTotal.setEditable(false);
        jtTotal.setPreferredSize(new java.awt.Dimension(70, 20));

        jtTxEntrega.setEditable(false);
        jtTxEntrega.setPreferredSize(new java.awt.Dimension(70, 20));

        jLabel11.setText("Tx Entrega:");

        jLabel12.setText("Desconto:");

        jtDesconto.setEditable(false);
        jtDesconto.setPreferredSize(new java.awt.Dimension(70, 20));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jLabel11)
                            .addGap(2, 2, 2)
                            .addComponent(jtTxEntrega, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jLabel12)
                            .addGap(2, 2, 2)
                            .addComponent(jtDesconto, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jLabel8)
                            .addGap(2, 2, 2)
                            .addComponent(jtTotal, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 378, Short.MAX_VALUE)
                        .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, 378, Short.MAX_VALUE)
                        .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(jtTotal, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel11)
                    .addComponent(jtTxEntrega, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel12)
                    .addComponent(jtDesconto, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        pack();
        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        java.awt.Dimension dialogSize = getSize();
        setLocation((screenSize.width-dialogSize.width)/2,(screenSize.height-dialogSize.height)/2);
    }// </editor-fold>//GEN-END:initComponents

    private void jtfNomeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtfNomeActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jtfNomeActionPerformed

    private void jcbBairroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbBairroActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jcbBairroActionPerformed

    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JComboBox jcbBairro;
    private javax.swing.JTextField jftRua;
    private javax.swing.JFormattedTextField jftfRg;
    private javax.swing.JTextField jtDesconto;
    private javax.swing.JTable jtTabelaAcomp;
    private javax.swing.JTable jtTabelaPizzas;
    private javax.swing.JTextField jtTotal;
    private javax.swing.JTextField jtTxEntrega;
    private javax.swing.JTextField jtfComp;
    private javax.swing.JFormattedTextField jtfDataNasc;
    private javax.swing.JTextField jtfNome;
    private javax.swing.JFormattedTextField jtfNum;
    private javax.swing.JFormattedTextField jtftel_1;
    private javax.swing.JFormattedTextField jtftel_2;
    // End of variables declaration//GEN-END:variables
}
